﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="List.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Content.Atl.List"
    Title="模板属性列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" rel="Stylesheet" href="/Cellula_Client/controls/JskitControls.css" />
    <script type="text/javascript" src="/jskit.org/model/controls/JskitRichDropDownList.js"></script>
    <script type="text/javascript">
        var jrddlCategory = new JskitRichDropDownList("jrddlCategory");
        function PageOnLoad() {
            jrddlCategory.setEmptySelectText("-全部-");
            jrddlCategory.deployTree(fixId("txt_CategoryName"), fixId("hid_CategoryId"), "Ws/_Category.aspx?ok=&rk=");
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
    分类属性模板管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <asp:HiddenField runat="server" ID="hid_TypeKey" />
    <asp:HiddenField runat="server" ID="hid_SelectedKey" />
    <div>
        <table>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    选择分类：
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txt_CategoryName"></asp:TextBox>
                    <asp:HiddenField runat="server" ID="hid_CategoryId" />
                </td>
            </tr>
        </table>
    </div>
    <div class="action_bar">
        <asp:Button ID="btn_Query" runat="server" Text="查询" OnClick="btn_Query_Click" />
        <asp:Button ID="btn_type_add" runat="server" Text="增加" OnClick="btn_type_add_Click" />
        <asp:Button ID="btn_type_update" runat="server" Text="修改" OnClientClick="return acu.gv.checkMultiSelect(fixId('gvlist'));"
            OnClick="btn_type_update_Click" />
        <asp:Button ID="btn_type_delete" runat="server" Text="删除" OnClientClick="return acu.gv.checkDelete(fixId('gvlist'));"
            OnClick="btn_type_delete_Click" />
    </div>
    <fieldset>
        <legend>属性列表</legend>
        <asp:GridView ID="gvlist" runat="server" AutoGenerateColumns="false" CssClass="GridView"
            DataKeyNames="AtlKey" AllowPaging="True" PageSize="20" PagerSettings-Mode="Numeric"
            OnPageIndexChanging="gvlist_PageIndexChanging" OnRowCommand="gvlist_RowCommand">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="CheckAll" onclick="return acu.gv.selectAll(this,event);" tabindex="0"
                            type="checkbox" title="点击全选或反全选当前页所有信息" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbxRow" runat="server" CausesValidation="False"></asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle Width="10px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="名称">
                    <ItemTemplate>
                        <a href='admin/Content/Atl/EditAtl.aspx?id=<%# DataBinder.Eval(Container, "DataItem.AtlKey")%>'>
                            <%# DataBinder.Eval(Container, "DataItem.AtlName")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="分类">
                    <ItemTemplate>
                        <a href='admin/Content/Atl/List.aspx?cid=<%# DataBinder.Eval(Container, "DataItem.CategoryKey")%>'>
                            <%# DataBinder.Eval(Container, "DataItem.CategoryName")%></a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="DefaultValue" HeaderText="缺省值"></asp:BoundField>
                <asp:BoundField DataField="FieldTypeName" HeaderText="类型"></asp:BoundField>
                <asp:BoundField DataField="VisiableRoleName" HeaderText="可查看"></asp:BoundField>
                <asp:BoundField DataField="EditableRoleName" HeaderText="可编辑"></asp:BoundField>
                <asp:BoundField DataField="OrderNumber" HeaderText="排序">
                    <ItemStyle Width="20px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="查询项">
                    <ItemTemplate>
                        <div class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsQueriable")%>'>
                        </div>
                    </ItemTemplate>
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="报表项">
                    <ItemTemplate>
                        <div class='sign_yn<%# DataBinder.Eval(Container, "DataItem.IsReport")%>'>
                        </div>
                    </ItemTemplate>
                    <ItemStyle Width="30px" />
                </asp:TemplateField>
                <asp:BoundField DataField="CountRuleName" HeaderText="计算规则"></asp:BoundField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lbtn_SubList" CommandName="CheckSubList" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.AtlKey") %>'>&gt;&gt;</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerTemplate>
                <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
            </PagerTemplate>
            <HeaderStyle CssClass="GridViewHeader" />
            <RowStyle CssClass="GridViewRow" />
            <FooterStyle CssClass="GirdViewFooter" />
            <AlternatingRowStyle CssClass="GirdViewAlternatingRow" />
            <PagerStyle CssClass="GridViewPager" />
            <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
            <EmptyDataTemplate>
                没有可用的数据</EmptyDataTemplate>
        </asp:GridView>
    </fieldset>
    <div class="action_bar">
        <asp:Button ID="btn_value_add" runat="server" Text="增加" OnClick="btn_value_add_Click" />
        <asp:Button ID="btn_value_update" runat="server" Text="修改" OnClientClick="return acu.gv.checkModify(fixId('gvSubList'));"
            OnClick="btn_value_update_Click" />
        <asp:Button ID="btn_value_delete" runat="server" Text="删除" OnClientClick="return acu.gv.checkDelete(fixId('gvSubList'));"
            OnClick="btn_value_delete_Click" />
    </div>
    <fieldset>
        <legend>选择项</legend>
        <asp:GridView ID="gvSubList" runat="server" AutoGenerateColumns="false" CssClass="GridView"
            DataKeyNames="OptKey" AllowPaging="True" PageSize="20" PagerSettings-Mode="Numeric">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="CheckAll" onclick="return acu.gv.selectAll(this,event);" tabindex="0"
                            type="checkbox" title="点击全选或反全选当前页所有信息" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbxRow" runat="server" CssClass="GRIlinkbutton" CausesValidation="False">
                        </asp:CheckBox>
                    </ItemTemplate>
                    <ItemStyle Width="10px" />
                </asp:TemplateField>
                <asp:BoundField DataField="OptText" HeaderText="名称"></asp:BoundField>
                <asp:BoundField DataField="OrderNumber" HeaderText="排序值">
                    <ItemStyle Width="30px" />
                </asp:BoundField>
            </Columns>
            <PagerTemplate>
                <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
            </PagerTemplate>
            <HeaderStyle CssClass="GridViewHeader" />
            <RowStyle CssClass="GridViewRow" />
            <FooterStyle CssClass="GirdViewFooter" />
            <AlternatingRowStyle CssClass="GirdViewAlternatingRow" />
            <PagerStyle CssClass="GridViewPager" />
            <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
            <EmptyDataTemplate>
                没有可用的数据</EmptyDataTemplate>
        </asp:GridView>
    </fieldset>
</asp:Content>
